home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / Toolbox / Live Scroll 1.0 / Sources / BareBones.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-13  |  2.1 KB  |  178 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        BareBones.h
  3.  
  4.     Contains:    Common header file included by all source files
  5.  
  6.     Written by:    Chris White, Developer Technical Support
  7.     
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9.     
  10.     Change History (most recent first):
  11.     
  12.             12/18/95            CW        First release
  13.  
  14. */
  15.  
  16.  
  17.  
  18. #ifndef __BAREBONES__
  19. #define __BAREBONES__
  20.  
  21.  
  22.  
  23. // System includes
  24. #ifndef __CONTROLS__
  25.     #include <Controls.h>
  26. #endif
  27.  
  28. #ifndef __QDOFFSCREEN__
  29.     #include <QDOffscreen.h>
  30. #endif
  31.  
  32.  
  33.  
  34. // Application includes
  35. #ifndef __SCROLLBARS__
  36.     #include "ScrollBars.h"
  37. #endif
  38.  
  39.  
  40.  
  41.  
  42. #define DEBUGGING            1            // Anything that shouldn't normally occur
  43. #define WARNINGS            0            // Something that can occur, but you might like to know about
  44.  
  45.  
  46. #define kFourQuestionMarks    0x3F3F3F3F    // C++ compilers that expand trigraphs don't
  47.                                         // like '????'. This should keep them all happy.
  48.  
  49.  
  50. enum
  51. {
  52.     // Generall application stuff
  53.     
  54.     kCreatorCode = kFourQuestionMarks,
  55.     kSleepTime = 60L
  56.  
  57. };
  58.  
  59.  
  60.  
  61. enum
  62. {
  63.     // Menu ID numbers
  64.     
  65.     kMenuBarID = 1000,
  66.     kAppleMenu = 1000,
  67.     kFileMenu = 1001
  68. };
  69.  
  70.  
  71.  
  72. enum
  73. {
  74.     // Apple menu commands
  75.     
  76.     cAbout = 1
  77. };
  78.  
  79.  
  80.  
  81. enum
  82. {
  83.     // File menu commands
  84.     
  85.     cQuit = 1
  86. };
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93. enum
  94. {
  95.     // Error strings
  96.     
  97.     kNeedSystem7 = 1,
  98.     kNeedColorQuickdraw,
  99.     kGenericErrorStr
  100. };
  101.  
  102.  
  103.  
  104. enum
  105. {
  106.     // Windows
  107.     
  108.     kDisplayWindow = 1000,
  109.     kAboutDialog = 1000,
  110.      kErrorDialog
  111. };
  112.  
  113.  
  114.  
  115. enum
  116. {
  117.     // Strings
  118.  
  119.     kErrorStrings = 1000
  120. };
  121.  
  122.  
  123.  
  124. enum
  125. {
  126.     // Misc Resources
  127.  
  128.     kPictureID = 1000,
  129.     kScrollBar = 1000
  130. };
  131.  
  132.  
  133.  
  134. enum
  135. {
  136.     // Misc constants
  137.  
  138.     kNoFlags = 0
  139. };
  140.  
  141.  
  142.  
  143.  
  144. struct WindowInfo
  145. {
  146.     ControlRef    hScrollBar;
  147.     ControlRef    vScrollBar;
  148.     GWorldPtr    offscreen;
  149. };
  150.  
  151. typedef struct WindowInfo tWindowInfo, *tWindowInfoPtr;
  152.  
  153.  
  154.  
  155. // Global Variable Definitions. This allows me to include this file
  156. // in all sources with the extern keyword used in all instances except
  157. // the main source file.
  158.  
  159. #ifdef __MAIN__
  160.     #define    global
  161. #else
  162.     #define    global    extern
  163. #endif
  164.  
  165.  
  166. global    Boolean                    gQuit;                      // quit program flag
  167. global    Boolean                    gInBackground;
  168. global    SInt32                    gSleepTime;
  169.  
  170. global    ControlActionUPP        gScrollControlActionUPP;
  171. global    IndicatorActionUPP        gScrollThumbActionUPP;
  172.  
  173.  
  174.  
  175.  
  176.  
  177. #endif    // __BAREBONES__
  178.